home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / OpenGL / extensions / spec / convolution.spec < prev    next >
Encoding:
Text File  |  1996-11-11  |  41.2 KB  |  938 lines

  1. Name
  2.  
  3.     EXT_convolution
  4.  
  5. Name Strings
  6.  
  7.     GL_EXT_convolution
  8.  
  9. Version
  10.  
  11.     $Date: 1995/09/30 02:30:56 $ $Revision: 1.1 $
  12.  
  13. Number
  14.  
  15.     12
  16.  
  17. Dependencies
  18.  
  19.     EXT_abgr affects the definition of this extension
  20.     EXT_texture is required
  21.     EXT_copy_texture affects the definition of this extension
  22.  
  23. Overview
  24.  
  25.     This extension defines 1 and 2 dimensional convolution operations
  26.     at a fixed location in the pixel transfer process.  Thus pixel drawing,
  27.     reading, and copying, as well as texture image definition, are all
  28.     candidates for convolution.  The convolution kernels are themselves
  29.     treated as 1 and 2 dimensional images, which can be loaded from
  30.     application memory or from the framebuffer.
  31.  
  32.     This extension is designed to accommodate 3D convolution, but the
  33.     API is left for a future extension.
  34.  
  35. New Procedures and Functions
  36.  
  37.     void ConvolutionFilter1DEXT(enum target,
  38.                 enum internalformat,
  39.                 sizei width,
  40.                 enum format,
  41.                 enum type,
  42.                 const void* image);
  43.  
  44.     void ConvolutionFilter2DEXT(enum target,
  45.                 enum internalformat,
  46.                 sizei width,
  47.                 sizei height,
  48.                 enum format,
  49.                 enum type,
  50.                 const void* image);
  51.  
  52.     void CopyConvolutionFilter1DEXT(enum target,
  53.                     enum internalformat,
  54.                     int x,
  55.                     int y,
  56.                     sizei width);
  57.  
  58.     void CopyConvolutionFilter2DEXT(enum target,
  59.                     enum internalformat,
  60.                     int x,
  61.                     int y,
  62.                     sizei width,
  63.                     sizei height);
  64.  
  65.     void GetConvolutionFilterEXT(enum target,
  66.                  enum format,
  67.                  enum type,
  68.                  void* image);
  69.  
  70.     void SeparableFilter2DEXT(enum target,
  71.                   enum internalformat,
  72.                   sizei width,
  73.                   sizei height,
  74.                   enum format,
  75.                   enum type,
  76.                   const void* row,
  77.                   const void* column);
  78.  
  79.     void GetSeparableFilterEXT(enum target,
  80.                    enum format,
  81.                    enum type,
  82.                    void* row,
  83.                    void* column,
  84.                    void* span);
  85.  
  86.     void ConvolutionParameteriEXT(enum target,
  87.                       enum pname,
  88.                       int param);
  89.  
  90.     void ConvolutionParameterivEXT(enum target,
  91.                    enum pname,
  92.                    const int* params);
  93.  
  94.     void ConvolutionParameterfEXT(enum target,
  95.                   enum pname,
  96.                   float param);
  97.  
  98.     void ConvolutionParameterfvEXT(enum target,
  99.                    enum pname,
  100.                    const float* params);
  101.  
  102.     void GetConvolutionParameterivEXT(enum target,
  103.                       enum pname,
  104.                       int* params);
  105.  
  106.     void GetConvolutionParameterfvEXT(enum target,
  107.                       enum pname,
  108.                       float* params);
  109.  
  110. New Tokens
  111.  
  112.     Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
  113.     the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
  114.     GetDoublev, and by the <target> parameter of ConvolutionFilter1DEXT,
  115.     CopyConvolutionFilter1DEXT, GetConvolutionFilterEXT,
  116.     ConvolutionParameteriEXT, ConvolutionParameterfEXT,
  117.     ConvolutionParameterivEXT, ConvolutionParameterfvEXT,
  118.     GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT:
  119.  
  120.     CONVOLUTION_1D_EXT               0x8010
  121.  
  122.     Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
  123.     the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
  124.     GetDoublev, and by the <target> parameter of ConvolutionFilter2DEXT,
  125.     CopyConvolutionFilter2DEXT, GetConvolutionFilterEXT,
  126.     ConvolutionParameteriEXT, ConvolutionParameterfEXT,
  127.     ConvolutionParameterivEXT, ConvolutionParameterfvEXT,
  128.     GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT:
  129.  
  130.     CONVOLUTION_2D_EXT               0x8011
  131.  
  132.     Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, by
  133.     the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
  134.     GetDoublev, and by the <target> parameter of SeparableFilter2DEXT,
  135.     SeparableFilter2DEXT, GetSeparableFilterEXT,
  136.     ConvolutionParameteriEXT, ConvolutionParameterfEXT,
  137.     ConvolutionParameterivEXT, ConvolutionParameterfvEXT,
  138.     GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT:
  139.  
  140.     SEPARABLE_2D_EXT                 0x8012
  141.  
  142.     Accepted by the <pname> parameter of ConvolutionParameteriEXT,
  143.     ConvolutionParameterfEXT, ConvolutionParameterivEXT,
  144.     ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, and
  145.     GetConvolutionParameterfvEXT:
  146.  
  147.     CONVOLUTION_BORDER_MODE_EXT      0x8013
  148.  
  149.     Accepted by the <pname> parameter of ConvolutionParameterivEXT,
  150.     ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, and
  151.     GetConvolutionParameterfvEXT:
  152.  
  153.     CONVOLUTION_FILTER_SCALE_EXT     0x8014
  154.     CONVOLUTION_FILTER_BIAS_EXT      0x8015
  155.  
  156.     Accepted by the <param> parameter of ConvolutionParameteriEXT,
  157.     and ConvolutionParameterfEXT, and by the <params> parameter of
  158.     ConvolutionParameterivEXT and ConvolutionParameterfvEXT, when the
  159.     <pname> parameter is CONVOLUTION_BORDER_MODE_EXT:
  160.  
  161.     REDUCE_EXT                       0x8016
  162.  
  163.     Accepted by the <pname> parameter of GetConvolutionParameterivEXT and
  164.     GetConvolutionParameterfvEXT:
  165.  
  166.     CONVOLUTION_FORMAT_EXT           0x8017
  167.     CONVOLUTION_WIDTH_EXT            0x8018
  168.     CONVOLUTION_HEIGHT_EXT           0x8019
  169.     MAX_CONVOLUTION_WIDTH_EXT        0x801A
  170.     MAX_CONVOLUTION_HEIGHT_EXT       0x801B
  171.  
  172.     Accepted by the <pname> parameter of PixelTransferi, PixelTransferf,
  173.     and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
  174.     and GetDoublev:
  175.  
  176.     POST_CONVOLUTION_RED_SCALE_EXT   0x801C
  177.     POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
  178.     POST_CONVOLUTION_BLUE_SCALE_EXT  0x801E
  179.     POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
  180.     POST_CONVOLUTION_RED_BIAS_EXT    0x8020
  181.     POST_CONVOLUTION_GREEN_BIAS_EXT  0x8021
  182.     POST_CONVOLUTION_BLUE_BIAS_EXT   0x8022
  183.     POST_CONVOLUTION_ALPHA_BIAS_EXT  0x8023
  184.  
  185. Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
  186.  
  187.     None
  188.  
  189. Additions to Chapter 3 of the 1.0 Specification (Rasterization)
  190.  
  191.     The specification of convolution operators is added to the GL
  192.     Specification in section 3.6.2, "Pixel Transfer Modes."  A 2-dimensional
  193.     convolution filter image is specified using the ConvolutionFilter2DEXT
  194.     command.  Its <target> parameter must be CONVOLUTION_2D_EXT.  Its
  195.     <internalformat> parameter specifies the format of image that will be
  196.     retained; it must be one of LUMINANCE, LUMINANCE_ALPHA, INTENSITY_EXT,
  197.     RGB, or RGBA.  Its <width>, <height>, <format>, <type>,
  198.     and <image> parameters specify an image in memory with exactly the same
  199.     semantics of the corresponding parameters to DrawPixels.  
  200.  
  201.     The specified image is extracted from memory and processed just as if
  202.     DrawPixels were called, stopping after the Final Expansion to RGBA step
  203.     is completed. The R, G, B, and A components of each pixel are then scaled
  204.     by the four 2D CONVOLUTION_FILTER_SCALE_EXT parameters, then biased by the
  205.     four 2D CONVOLUTION_FILTER_BIAS_EXT parameters.  These parameters are
  206.     themselves specified by calling ConvolutionParameterivEXT or 
  207.     ConvolutionParameterfvEXT with <target> CONVOLUTION_2D_EXT, <pname>
  208.     CONVOLUTION_FILTER_SCALE_EXT or CONVOLUTION_FILTER_BIAS_EXT, and <params>
  209.     pointing to a vector of four values: red, green, blue, and alpha, in that
  210.     order.  The R, G, B, and A values are not clamped to [0,1] at any time 
  211.     during this process.
  212.  
  213.     Each pixel is then converted to have the specified internal format.
  214.     This conversion simply maps the component values of the pixel (R, G, B,
  215.     and A) to the values included in the internal format (red, green, blue,
  216.     alpha, luminance, and intensity).  The mapping is as follows:
  217.  
  218.     Internal Format        red    green    blue    alpha    luminance intensity
  219.     ---------------        ---    -----    ----    -----    --------- ---------
  220.  
  221.     LUMINANCE                        R
  222.     LUMINANCE_ALPHA                    A    R
  223.     INTENSITY_EXT                              R
  224.     RGB            R    G    B
  225.     RGBA            R    G    B    A
  226.  
  227.     The red, green, blue, alpha, luminance, and/or intensity components of
  228.     the pixels are stored in floating point, rather than integer format.
  229.     They form a 2-dimensional image indexed with coordinates i,j such that i
  230.     increases from left to right, starting at zero, and j increases from
  231.     bottom to top, also starting at zero.  Image location i,j is specified
  232.     by the Nth pixel, counting from zero, where N is i+j*width.
  233.  
  234.     The error INVALID_VALUE is generated if <width> or <height> is greater
  235.     than the maximum supported value.  This value is queried with
  236.     GetConvolutionParameterivEXT, setting <target> to CONVOLUTION_2D_EXT and
  237.     <pname> to MAX_CONVOLUTION_WIDTH_EXT or MAX_CONVOLUTION_HEIGHT_EXT,
  238.     respectively.
  239.  
  240.     A 1-dimensional convolution filter is defined using ConvolutionFilter1DEXT.
  241.     Its <target> parameter must be CONVOLUTION_1D_EXT.  Its <internalformat>,
  242.     <format>, and <type> parameters have identical semantics and accept the
  243.     same values as do their 2D counterparts.  <image> must point to a
  244.     1-dimensional image, however.  
  245.  
  246.     The 1-dimensional image is taken from memory and processed as if
  247.     ConvolutionFilter2DEXT were called with a height of 1, except that it is
  248.     scaled and biased by the two 1D vectors, rather than the 2D vectors.
  249.     (The 1D scale and bias vectors are specified using ConvolutionParameterivEXT
  250.     with <target> CONVOLUTION_1D_EXT and <pname> CONVOLUTION_FILTER_SCALE_EXT
  251.     or CONVOLUTION_FILTER_BIAS_EXT.) The 1-dimensional image is formed with
  252.     coordinates i such that i increases from left to right, starting at zero.
  253.     Image location i is specified by the ith pixel, counting from zero.
  254.  
  255.     The error INVALID_VALUE is generated if <width> is greater than the maximum
  256.     supported value, which is queried using GetConvolutionParameterivEXT, setting
  257.     <target> to CONVOLUTION_1D_EXT and <pname> to MAX_CONVOLUTION_WIDTH_EXT.
  258.  
  259.     If EXT_copy_texture is supported, one and 2-dimensional filters can also
  260.     be defined using image data in the framebuffer.  Rather than accepting
  261.     image data from memory, they copy image data from the color buffer
  262.     specified by the current ReadBuffer mode.  CopyConvolutionFilter2DEXT
  263.     accepts image data from a <width> pixel wide by <height> pixel high
  264.     color buffer region whose lower-left pixel has window coordinates <x>,<y>.
  265.     If any pixels within this region are outside the window that is
  266.     associated with the GL context, the values obtained for those pixels
  267.     are undefined.  
  268.  
  269.     These pixel values are processed exactly as if CopyPixels had been called,
  270.     up through the Final Expansion to RGBA step.  At this point all pixel component
  271.     values are treated exactly as if ConvolutionFilter2DEXT had been called,
  272.     beginning with the scaling of the color components by CONVOLUTION_FILTER_SCALE_EXT.
  273.     Pixel ordering is such that lower X screen coordinates correspond to lower i
  274.     filter image coordinates, and lower Y screen coordinates correspond to lower j
  275.     filter image coordinates.  The semantics and accepted values of the
  276.     <target> and <internalformat> parameters are exactly equivalent to their
  277.     ConvolutionFilter2DEXT counterparts.
  278.  
  279.     CopyConvolutionFilter1DEXT accepts image data from a <width> pixel wide
  280.     by 1 pixel high color buffer region whose left-most pixel has window
  281.     coordinates <x>,<y>.  If any pixels within this region are outside the
  282.     window that is associated with the GL context, the values obtained for
  283.     those pixels are undefined.
  284.  
  285.     The pixels are processed just as those of CopyConvolutionFilter2DEXT are, 
  286.     and they define a filter image such that lower X window coordinates
  287.     correspond to lower i filter image coordinates.  The semantics and accepted
  288.     values of the <target> and <internalformat> parameters are exactly equivalent
  289.     to their ConvolutionFilter1DEXT counterparts.
  290.  
  291.     Special facilities are provided for the definition of 2-dimensional
  292.     separable filters -- filters whose image can be represented as the
  293.     product of two 1-dimensional images, rather than as full
  294.     2-dimensional images.  A 2-dimensional convolution filter is specified
  295.     using SeparableFilter2DEXT.  Its <target> parameter must be
  296.     SEPARABLE_2D_EXT.  Its <internalformat> parameter specifies the formats
  297.     of two 1-dimensional images that will be retained; it must be one of
  298.     LUMINANCE, LUMINANCE_ALPHA, INTENSITY_EXT, RGB, or RGBA.  <row>
  299.     and <column> point to two 1-dimensional images in memory.  The <row>
  300.     image is <width> pixels wide, and is defined by <format> and <type>.
  301.     The <column> image is <height> pixels wide, and is also defined by
  302.     <format> and <type>.
  303.  
  304.     The two images are extracted from memory and processed just as if
  305.     ConvolutionFilter1DEXT were called separately for each, with the resulting
  306.     retained images replacing the current 2D separable filter images, except
  307.     that each image is scaled and biased using the 2D separable scale and bias
  308.     vectors.  (These vectors are specified using ConvolutionParameterivEXT with
  309.     <target> SEPARABLE_2D_EXT and <pname> CONVOLUTION_FILTER_SCALE_EXT or
  310.     CONVOLUTION_FILTER_BIAS_EXT.)
  311.  
  312.     The operations of the convolution filters are added to the GL
  313.     Specification in section 3.6.3, "Rasterization of Pixel Rectangles,
  314.     immediately following the subsection "Index Lookup", and immediately
  315.     prior to the operations described by EXT_histogram.  Filters are
  316.     enabled and disabled by calling Enable and Disable with filter name
  317.     passed as the <cap> parameter.  Convolution is performed only for RGBA
  318.     groups, though these groups may have been specified as color indexes
  319.     and converted to RGBA by index table lookup.  
  320.  
  321.     If CONVOLUTION_1D_EXT is enabled, the 1-dimensional convolution filter
  322.     is applied only to the image passed to TexImage1D, and to 1-dimensional
  323.     textures queried by GetTexImage.  If CONVOLUTION_2D_EXT is enabled, the
  324.     2-dimensional convolution filter is applied only to the 2D images passed
  325.     to DrawPixels, CopyPixels, ReadPixels, TexImage2D, TexSubImage2DEXT,
  326.     CopyTexImage2DEXT, CopyTexSubImage2DEXT, and GetTexImage, and to 2-dimensional
  327.     images queried by GetTexImage.  If SEPARABLE_2D_EXT is enabled, and
  328.     CONVOLUTION_2D_EXT is disabled, the separable 2-dimensional convolution
  329.     filter is applied only to these same images.
  330.  
  331.     The convolution operation is a sum of products of source image pixels
  332.     and convolution filter pixels.  Source image pixels always have four
  333.     components: red, green, blue, and alpha, denoted in the equations below
  334.     as Rs, Gs, Bs, and As.  Filter pixels may be stored in one of five
  335.     formats, with 1, 2, 3, or 4 components.  These components are denoted
  336.     as Rf, Gf, Bf, Af, Lf, and If in the equations below.  The result of the
  337.     convolution operation is the 4-tuple R,G,B,A.  Depending on the internal
  338.     format of the filter, individual color components of each source image
  339.     pixel are convolved with one filter component, or are passed unmodified.
  340.     The rules for this are:
  341.  
  342.     Filter format        
  343.     -------------
  344.     LUMINANCE        R = convolve(Rs,Lf)    G = convolve(Gs,Lf)    B = convolve(Bs,Lf)    A = As
  345.     LUMINANCE_ALPHA        R = convolve(Rs,Lf)    G = convolve(Gs,Lf)    B = convolve(Bs,Lf)    A = convolve(As,Af)
  346.     INTENSITY        R = convolve(Rs,If)    G = convolve(Gs,If)    B = convolve(Bs,If)    A = convolve(As,If)
  347.     RGB            R = convolve(Rs,Rf)    G = convolve(Gs,Gf)    B = convolve(Bs,Bf)    A = As
  348.     RGBA            R = convolve(Rs,Rf)    G = convolve(Gs,Gf)    B = convolve(Bs,Bf)    A = convolve(As,Af)
  349.  
  350.     The convolution operation is defined differently for each of the three
  351.     convolution filters.  In the following equations the
  352.     
  353.     SUM{}{}equation
  354.     
  355.     notation indicate the sum of the equation evaluated for all combinations
  356.     of conditions indicated within the sets of curly brackets, and the "/"
  357.     notation indicates integer division, with truncation toward zero.
  358.  
  359.     The variables Wf and Hf refer to the dimensions of the convolution
  360.     filter.  The variables Ws and Hs refer to the dimensions of the
  361.     source pixel image.  
  362.  
  363.     The convolution equations are:
  364.  
  365.     1-dimensional filter:
  366.  
  367.         C[i] = SUM{n = 0 through Wf-1}
  368.         
  369.               Cs[i+n] * Cf[n]
  370.  
  371.     2-dimensional filter:
  372.  
  373.         C[i,j] = SUM{n = 0 through Wf-1}
  374.             {m = 0 through Hf-1}
  375.             
  376.             Cs[i+n,j+m] * Cf[n,m]
  377.  
  378.     2-dimensional separable filter:
  379.  
  380.         C[i,j] = SUM{n = 0 through Wf-1}
  381.             {m = 0 through Hf-1}
  382.  
  383.             Cs[i+n,j+m] * Crow[n] * Ccolumn[m]
  384.  
  385.     The convolution border mode for a specific convolution filter is
  386.     specified using ConvolutionParameteriEXT with the <target> parameter
  387.     set to the name of the filter, the <pname> parameter set to
  388.     CONVOLUTION_BORDER_MODE_EXT, and <param> set to REDUCE_EXT.  (This
  389.     extension defines only a single border mode.)  The width and height of
  390.     source images convolved with border mode REDUCE_EXT are reduced by
  391.     Wf-1 and Hf-1, respectively.  If this reduction would generate a
  392.     resulting image with zero or negative width and/or height, the output
  393.     is simply null, with no error generated.  The coordinates of the image
  394.     that results from a convolution with border mode REDUCE_EXT are zero
  395.     through Ws-Wf in width, and zero through Hs-Hf in height.  In
  396.     cases where errors can result from the specification of invalid image
  397.     dimensions, it is these resulting dimensions that are tested, not the
  398.     dimensions of the source image.  (A specific example is TexImage1D and
  399.     TexImage2D, which specify constraints for image dimensions.  Even if
  400.     TexImage1D or TexImage2D is called with a null pixel pointer, the
  401.     dimensions of the resulting texture image are those that would result
  402.     from the convolution of the specified image.)  
  403.  
  404.     If a convolution operation is performed, the resulting image is scaled
  405.     and biased by parameters specified using the PixelTransfer command.
  406.     These operations are:
  407.  
  408.     red = red * POST_CONVOLUTION_RED_SCALE_EXT
  409.         + POST_CONVOLUTION_RED_BIAS_EXT
  410.  
  411.     green = green * POST_CONVOLUTION_GREEN_SCALE_EXT
  412.           + POST_CONVOLUTION_GREEN_BIAS_EXT
  413.  
  414.     blue = blue * POST_CONVOLUTION_BLUE_SCALE_EXT
  415.          + POST_CONVOLUTION_BLUE_BIAS_EXT
  416.  
  417.     alpha = alpha * POST_CONVOLUTION_ALPHA_SCALE_EXT
  418.           + POST_CONVOLUTION_ALPHA_BIAS_EXT
  419.  
  420.     If no convolution operation is performed, the scale and bias are not
  421.     performed either.
  422.  
  423. Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
  424. and the Framebuffer)
  425.  
  426.     The operation of convolution during pixel copy and query operations is
  427.     identical to the operation during pixel drawing and texture image
  428.     definition.
  429.  
  430. Additions to Chapter 5 of the 1.0 Specification (Special Functions)
  431.  
  432.     Commands GetConvolutionFilterEXT, GetSeparableFilterEXT,
  433.     GetConvolutionParameterivEXT, and GetConvolutionParameterfvEXT are not
  434.     included in display lists.  They are always executed immediately.
  435.  
  436. Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
  437.  
  438.     Integer and floating point query functions GetConvolutionParameterivEXT
  439.     and GetConvolutionParameterfvEXT are provided.  <target> must be
  440.     CONVOLUTION_1D_EXT, CONVOLUTION_2D_EXT, or SEPARABLE_2D_EXT.  <pname>
  441.     is one of CONVOLUTION_FORMAT_EXT, CONVOLUTION_WIDTH_EXT,
  442.     CONVOLUTION_HEIGHT_EXT, MAX_CONVOLUTION_WIDTH_EXT, or
  443.     MAX_CONVOLUTION_HEIGHT_EXT.  The value of the specified parameter is
  444.     returned in <params>.
  445.  
  446.     The current contents of a convolution filter image are queried using
  447.     GetConvolutionFilterEXT.  <target> must be CONVOLUTION_1D_EXT or
  448.     CONVOLUTION_2D_EXT.  <format> must be one of RED, GREEN, BLUE, ALPHA,
  449.     RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA.  <type> must be
  450.     UNSIGNED_BYTE, BYTE, UNSIGNED_SHORT, SHORT, UNSIGNED_INT, INT, or FLOAT.
  451.     The 1-dimensional or 2-dimensional image is returned to <image>.  No
  452.     pixel transfer operations are performed on this image, but pixel storage
  453.     modes that are applicable are performed.  Color component are converted
  454.     from the internal floating point representation to <type> according to
  455.     table 2.4. Prior to the conversion, if <type> is one of UNSIGNED_BYTE,
  456.     UNSIGNED_SHORT, or UNSIGNED_INT, the color components are clamped to
  457.     0..1, if <type> is one of BYTE, SHORT, or INT, the components are
  458.     clamped to -1..1.  No clamping is performed if <type> is FLOAT.  Color
  459.     components that are requested in the specified <format>, but which are
  460.     not included in the internal format of the filter image, are returned as
  461.     zero.  The assignments of internal color components to the components
  462.     requested by <format> are
  463.  
  464.         internal component    resulting component
  465.         ------------------    -------------------
  466.         red            red
  467.         green            green
  468.         blue            blue
  469.         alpha            alpha
  470.         luminance        red
  471.         intensity        red
  472.  
  473.     The current contents of a separable filter image are queried using
  474.     GetSeparableFilterEXT.  <target> must be SEPARABLE_2D_EXT.  <format>
  475.     and <type> accept the same values as do the corresponding parameters
  476.     of GetConvolutionFilterEXT.  The row and column images are returned to
  477.     <row> and <column> respectively.  No change is made to any location
  478.     related to <span>.  Pixel processing and component mapping are
  479.     identical to those of GetConvolutionFilterEXT.
  480.  
  481. Additions to the GLX Specification
  482.  
  483.     None
  484.     
  485. GLX Protocol
  486.  
  487.     Thirteen new GL commands are added.
  488.  
  489.     The following six rendering commands are sent to the server as part of a glXRender
  490.     request:
  491.  
  492.         CopyConvolutionFilter1DEXT
  493.             2           24              rendering command length
  494.             2           4107            rendering command opcode
  495.             4           ENUM            target
  496.             4           ENUM            internalformat
  497.             4           INT32           x
  498.             4           INT32           y
  499.             4           INT32           width
  500.  
  501.         CopyConvolutionFilter2DEXT
  502.             2           28              rendering command length
  503.             2           4108            rendering command opcode
  504.             4           ENUM            target
  505.             4           ENUM            internalformat
  506.             4           INT32           x
  507.             4           INT32           y
  508.             4           INT32           width
  509.             4           INT32           height
  510.  
  511.         ConvolutionParameteriEXT
  512.             2           16                 rendering command length
  513.             2           4105               rendering command opcode
  514.             4           ENUM               target
  515.             4           ENUM        pname
  516.             0x8013        CONVOLUTION_BORDER_MODE_EXT
  517.             4           INT32              param
  518.  
  519.         ConvolutionParameterivEXT
  520.             2           12+4*n          rendering command length
  521.             2           4106            rendering command opcode
  522.             4           ENUM            target
  523.             4           ENUM            pname
  524.             0x8013    n=1    CONVOLUTION_BORDER_MODE_EXT
  525.             0x8014    n=4    CONVOLUTION_FILTER_SCALE_EXT
  526.             0x8015    n=4    CONVOLUTION_FILTER_BIAS_EXT
  527.             0x8017    n=1   CONVOLUTION_FORMAT_EXT
  528.             0x8018    n=1    CONVOLUTION_WIDTH_EXT  
  529.             0x8019    n=1    CONVOLUTION_HEIGHT_EXT  
  530.             0x801A    n=1    MAX_CONVOLUTION_WIDTH_EXT
  531.             0x801B      n=1    MAX_CONVOLUTION_HEIGHT_EXT
  532.             4*n         LISTofINT32       params
  533.  
  534.         ConvolutionParameterfEXT
  535.             2           16              rendering command length
  536.             2           4103            rendering command opcode
  537.             4           ENUM            target
  538.             4           ENUM            pname
  539.             0x8013        CONVOLUTION_BORDER_MODE_EXT
  540.             4           FLOAT32         param
  541.  
  542.         ConvolutionParameterfvEXT
  543.             2           12+4*n          rendering command length
  544.             2           4104            rendering command opcode
  545.             4           ENUM            target
  546.             4           ENUM            pname
  547.             0x8013    n=1    CONVOLUTION_BORDER_MODE_EXT
  548.             0x8014    n=4    CONVOLUTION_FILTER_SCALE_EXT
  549.             0x8015    n=4    CONVOLUTION_FILTER_BIAS_EXT
  550.             0x8017    n=1   CONVOLUTION_FORMAT_EXT
  551.             0x8018    n=1    CONVOLUTION_WIDTH_EXT  
  552.             0x8019    n=1    CONVOLUTION_HEIGHT_EXT  
  553.             0x801A    n=1    MAX_CONVOLUTION_WIDTH_EXT
  554.             0x801B      n=1    MAX_CONVOLUTION_HEIGHT_EXT
  555.             4*n         LISTofFLOAT32   params
  556.  
  557.     The following three rendering commands contain pixel data and are thus sent to the 
  558.     server as part of a glXRender request or as part of a glXRenderLarge request:
  559.  
  560.         ConvolutionFilter1DEXT
  561.             2           48+n+p          rendering command length
  562.             2           4101            rendering command opcode
  563.             1           BOOL            swap_bytes
  564.             1           BOOL            lsb_first
  565.             2                           unused
  566.             4           CARD32          row_length
  567.             4           CARD32          skip_rows
  568.             4           CARD32          skip_pixels
  569.             4           CARD32          alignment
  570.             4           ENUM            target
  571.             4           ENUM            internalformat
  572.             4           INT32           width
  573.             4           INT32           height
  574.             4           ENUM            format
  575.             4           ENUM            type
  576.             n           LISTofBYTE      pixels
  577.             p                           unused, p=pad(n)
  578.  
  579.             If the command is encoded in a glXRenderLarge request, the command
  580.             opcode and command length fields above are expanded to 4 bytes each:
  581.             4           52+n+p          rendering command length
  582.             4           4101            rendering command opcode
  583.  
  584.         If <width> < 0, <format> is invalid or <type> is invalid, then the command is 
  585.     erroneous and n=0. The structure of <pixels> is described in Appendix A of the 
  586.         GLX Protocol Specification, "Pixel Data", using the parameters <swap_bytes>, 
  587.         <lsb_first>, <row_length>, <skip_rows>, <skip_pixels>, <alignment>, <width>, 
  588.         <format>, and <type> as given in the request, and a height of 1.
  589.  
  590.         ConvolutionFilter2DEXT
  591.             2           48+n+p          rendering command length
  592.             2           4102            rendering command opcode
  593.             1           BOOL            swap_bytes
  594.             1           BOOL            lsb_first
  595.             2                           unused
  596.             4           CARD32          row_length
  597.             4           CARD32          skip_rows
  598.             4           CARD32          skip_pixels
  599.             4           CARD32          alignment
  600.             4           ENUM            target
  601.             4           ENUM            internalformat
  602.             4           INT32           width
  603.             4           INT32           height
  604.             4           ENUM            format
  605.             4           ENUM            type
  606.             n           LISTofBYTE      pixels
  607.             p                           unused, p=pad(n)
  608.  
  609.             If the command is encoded in a glXRenderLarge request, the command
  610.             opcode and command length fields above are expanded to 4 bytes each:
  611.             4           52+n+p          rendering command length
  612.             4           4102            rendering command opcode
  613.  
  614.         If <width> < 0, <height> < 0, <format> is invalid or <type> is invalid, then the 
  615.         command is erroneous and n=0. The structure of <pixels> is described in Appendix 
  616.         A of the GLX Protocol Specification, "Pixel Data", using the parameters <swap_bytes>, 
  617.         <lsb_first>, <row_length>, <skip_rows>, <skip_pixels>, <alignment>, <width>, 
  618.         <height>, <format>, and <type> as given in the request.
  619.  
  620.         SeparableFilter2DEXT
  621.             2           48+n1+p1+n2+p2  rendering command length
  622.             2           4109            rendering command opcode
  623.             1           BOOL            swap_bytes
  624.             1           BOOL            lsb_first
  625.             2                           unused
  626.             4           CARD32          row_length
  627.             4           CARD32          skip_rows
  628.             4           CARD32          skip_pixels
  629.             4           CARD32          alignment
  630.             4           ENUM            target
  631.             4           ENUM            internalformat
  632.             4           INT32           width
  633.             4           INT32           height
  634.             4           ENUM            format
  635.             4           ENUM            type
  636.             n1          LISTofBYTE      row
  637.             p1                          unused, p=pad(n)
  638.             n2          LISTofBYTE      column
  639.             p2                          unused, p=pad(n)
  640.  
  641.             If the command is encoded in a glXRenderLarge request, the command
  642.             opcode and command length fields above are expanded to 4 bytes each:
  643.             4           52+n+p          rendering command length
  644.             4           4109            rendering command opcode
  645.  
  646.         If <width> < 0, <height> < 0, <format> is invalid or <type> is invalid, then the 
  647.         command is erroneous and n=0. The structure of <row> is described in Appendix 
  648.         A of the GLX Protocol Specification, "Pixel Data", using the parameters <swap_bytes>, 
  649.         <lsb_first>, <row_length>, <skip_rows>, <skip_pixels>, <alignment>, <width>, 
  650.         <format>, and <type> as given in the request, and and a height of 1. The structure of 
  651.         <column> is the same (it is also a one-dimensional image) except that it is <height>
  652.         pixels wide, instead of <width> pixels wide.
  653.  
  654.     The remaining commands are non-rendering commands. These commands are sent
  655.     separately (i.e., not as part of a glXRender or glXRenderLarge request), using
  656.     the glXVendorPrivateWithReply request:
  657.  
  658.         GetConvolutionParameterivEXT
  659.             1           CARD8           opcode (X assigned)
  660.             1           17              GLX opcode (glXVendorPrivateWithReply)
  661.             2           5               request length
  662.             4           3               vendor specific opcode
  663.             4           GLX_CONTEXT_TAG context tag
  664.             4           ENUM            target
  665.             4           ENUM            pname
  666.           =>
  667.             1           1               reply
  668.             1                           unused
  669.             2           CARD16          sequence number
  670.             4           m               reply length, m = (n==1 ? 0 : n)
  671.             4                           unused
  672.             4           CARD32          n
  673.  
  674.             if (n=1) this follows:
  675.  
  676.             4           INT32           params
  677.             12                          unused
  678.  
  679.             otherwise this follows:
  680.  
  681.             16                          unused
  682.             n*4         LISTofINT32     params
  683.  
  684.         Note that n may be zero, indicating that a GL error occurred. 
  685.  
  686.  
  687.         GetConvolutionParameterfvEXT
  688.             1           CARD8           opcode (X assigned)
  689.             1           17              GLX opcode (glXVendorPrivateWithReply)
  690.             2           5               request length
  691.             4           2               vendor specific opcode
  692.             4           GLX_CONTEXT_TAG context tag
  693.             4           ENUM            target
  694.             4           ENUM            pname
  695.           =>
  696.             1           1               reply
  697.             1                           unused
  698.             2           CARD16          sequence number
  699.             4           m               reply length, m = (n==1 ? 0 : n)
  700.             4                           unused
  701.             4           CARD32          n
  702.  
  703.             if (n=1) this follows:
  704.  
  705.             4           FLOAT32         params
  706.             12                          unused
  707.  
  708.             otherwise this follows:
  709.  
  710.             16                          unused
  711.             n*4         LISTofFLOAT32   params
  712.  
  713.         Note that n may be zero, indicating that a GL error occurred. 
  714.  
  715.  
  716.         GetConvolutionFilterEXT
  717.             1           CARD8           opcode (X assigned)
  718.             1           17              GLX opcode (glXVendorPrivateWithReply)
  719.             2           7               request length
  720.             4           1               vendor specific opcode
  721.             4           GLX_CONTEXT_TAG context tag
  722.             4           ENUM            target
  723.             4           ENUM            format
  724.             4           ENUM            type
  725.             1           BOOL            swap_bytes
  726.             3                           unused
  727.           =>
  728.             1           1               reply
  729.             1                           unused
  730.             2           CARD16          sequence number
  731.             4           n               reply length
  732.         8                unused
  733.             4           INT32        width
  734.             4           INT32        height
  735.             8                           unused
  736.             4*n         LISTofBYTE      pixels
  737.  
  738.     Note that n may be zero, indicating that a GL error occurred.
  739.  
  740.         If <format> or <type> is invalid then the command is erroneous and n=0. The structure 
  741.         of <pixels> is described in Appendix A of the GLX Protocol Specification, "Pixel Data",
  742.         using the parameters <swap_bytes>, <format>, and <type>. No extra padding is needed after
  743.         <pixels> because the image format already pads to 32 bits.
  744.  
  745.  
  746.         GetSeparableFilterEXT
  747.             1           CARD8           opcode (X assigned)
  748.             1           17              GLX opcode (glXVendorPrivateWithReply)
  749.             2           7               request length
  750.             4           4               vendor specific opcode
  751.             4           GLX_CONTEXT_TAG context tag
  752.             4           ENUM            target
  753.             4           ENUM            format
  754.             4           ENUM            type
  755.             1           BOOL            swap_bytes
  756.             3                           unused
  757.           =>
  758.             1           1               reply
  759.             1                           unused
  760.             2           CARD16          sequence number
  761.             4           n               reply length
  762.         8                unused
  763.             4           INT32        width
  764.             4           INT32        height
  765.             8                           unused
  766.             4*n         LISTofBYTE      row followed by column
  767.  
  768.     Note that n may be zero, indicating that a GL error occurred.
  769.  
  770.         If <format> or <type> is invalid then the command is erroneous and n=0. The structure 
  771.         of <pixels> is described in Appendix A of the GLX Protocol Specification, "Pixel Data",
  772.         using the parameters <swap_bytes>, <format>, and <type>. No extra padding is needed after
  773.         <pixels> because the image format already pads to 32 bits.
  774.  
  775. Dependencies on EXT_abgr
  776.  
  777.     If EXT_abgr is supported, the <format> parameters of
  778.     ConvolutionFilter1DEXT, ConvolutionFilter2DEXT, GetConvolutionFilterEXT,
  779.     SeparableFilter2DEXT, and GetSeparableFilterEXT accept ABGR_EXT.
  780.     Otherwise they do not.
  781.  
  782. Dependencies on EXT_texture
  783.  
  784.     EXT_texture is required.  This extension builds on the notion of
  785.     internal image format, which is defined by EXT_texture.
  786.  
  787. Dependencies on EXT_copy_texture
  788.  
  789.     If EXT_copy_texture is not supported, commands CopyConvolutionFilter1DEXT
  790.     and CopyConvolutionFilter2DEXT are not supported.
  791.  
  792. Errors
  793.  
  794.     INVALID_ENUM is generated if ConvolutionFilter1DEXT parameter <target>
  795.     is not CONVOLUTION_1D_EXT.
  796.  
  797.     INVALID_ENUM is generated if ConvolutionFilter2DEXT parameter <target>
  798.     is not CONVOLUTION_2D_EXT.
  799.  
  800.     INVALID_ENUM is generated if CopyConvolutionFilter1DEXT parameter
  801.     <target> is not CONVOLUTION_1D_EXT.
  802.  
  803.     INVALID_ENUM is generated if CopyConvolutionFilter2DEXT parameter
  804.     <target> is not CONVOLUTION_2D_EXT.
  805.  
  806.     INVALID_ENUM is generated if SeparableFilter2DEXT parameter <target>
  807.     is not SEPARABLE_2D_EXT.
  808.  
  809.     INVALID_ENUM is generated if GetConvolutionFilterEXT parameter <target>
  810.     is not CONVOLUTION_1D_EXT or CONVOLUTION_2D_EXT.
  811.  
  812.     INVALID_ENUM is generated if GetSeparableFilterEXT parameter <target>
  813.     is not SEPARABLE_2D_EXT.
  814.  
  815.     INVALID_ENUM is generated if ConvolutionParameteriEXT,
  816.     ConvolutionParameterfEXT, ConvolutionParameterivEXT,
  817.     ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, or
  818.     GetConvolutionParameterfvEXT parameter <target> is not
  819.     CONVOLUTION_1D_EXT, CONVOLUTION_2D_EXT, or SEPARABLE_2D_EXT.
  820.  
  821.     INVALID_ENUM is generated if ConvolutionFilter1DEXT,
  822.     ConvolutionFilter2DEXT, CopyConvolutionFilter1DEXT,
  823.     CopyConvolutionFilter2DEXT, or SeparableFilter2DEXT parameter
  824.     <internalformat> is not LUMINANCE, LUMINANCE_ALPHA, INTENSITY, RGB,
  825.     or RGBA.
  826.  
  827.     INVALID_VALUE is generated if ConvolutionFilter1DEXT parameter <width>
  828.     is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried
  829.     using GetConvolutionParameterivEXT with <target> CONVOLUTION_1D_EXT.
  830.  
  831.     INVALID_VALUE is generated if ConvolutionFilter2DEXT parameter <width>
  832.     is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried
  833.     using GetConvolutionParameterivEXT with <target> CONVOLUTION_2D_EXT.
  834.  
  835.     INVALID_VALUE is generated if CopyConvolutionFilter1DEXT parameter
  836.     <width> is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT
  837.     as queried using GetConvolutionParameterivEXT with <target>
  838.     CONVOLUTION_1D_EXT.
  839.  
  840.     INVALID_VALUE is generated if CopyConvolutionFilter2DEXT parameter
  841.     <width> is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT
  842.     as queried using GetConvolutionParameterivEXT with <target>
  843.     CONVOLUTION_2D_EXT.
  844.  
  845.     INVALID_VALUE is generated if SeparableFilter2DEXT parameter <width>
  846.     is less than zero, or greater than MAX_CONVOLUTION_WIDTH_EXT as queried
  847.     using GetConvolutionParameterivEXT with <target> SEPARABLE_2D_EXT.
  848.  
  849.     INVALID_VALUE is generated if ConvolutionFilter2DEXT parameter <height>
  850.     is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT as queried
  851.     using GetConvolutionParameterivEXT with <target> CONVOLUTION_2D_EXT.
  852.  
  853.     INVALID_VALUE is generated if CopyConvolutionFilter2DEXT parameter
  854.     <height> is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT
  855.     as queried using GetConvolutionParameterivEXT with <target>
  856.     CONVOLUTION_2D_EXT.
  857.  
  858.     INVALID_VALUE is generated if SeparableFilter2DEXT parameter <height>
  859.     is less than zero, or greater than MAX_CONVOLUTION_HEIGHT_EXT as queried
  860.     using GetConvolutionParameterivEXT with <target> SEPARABLE_2D_EXT.
  861.  
  862.     INVALID_ENUM is generated if ConvolutionFilter1DEXT,
  863.     ConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT,
  864.     or GetSeparableFilterEXT parameter <format> is not RED, GREEN, BLUE, ALPHA,
  865.     RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA.
  866.  
  867.     INVALID_ENUM is generated if ConvolutionFilter1DEXT,
  868.     ConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT,
  869.     or GetSeparableFilterEXT parameter <type> is not UNSIGNED_BYTE, BYTE,
  870.     UNSIGNED_SHORT, SHORT, UNSIGNED_INT, INT, or FLOAT.
  871.  
  872.     INVALID_ENUM is generated if ConvolutionParameterivEXT or
  873.     ConvolutionParameterfvEXT parameter <pname> is not
  874.     CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT,
  875.     or CONVOLUTION_BORDER_MODE_EXT.
  876.  
  877.     INVALID_ENUM is generated if ConvolutionParameteriEXT or
  878.     ConvolutionParameterfEXT parameter <pname> is not
  879.     CONVOLUTION_BORDER_MODE_EXT.
  880.  
  881.     INVALID_ENUM is generated if ConvolutionParameteriEXT,
  882.     ConvolutionParameterfEXT, ConvolutionParameterivEXT, or
  883.     ConvolutionParameterfvEXT parameter <pname> is
  884.     CONVOLUTION_BORDER_MODE_EXT and parameter <params> is not REDUCE_EXT.
  885.  
  886.     INVALID_ENUM is generated if GetConvolutionParameterivEXT or
  887.     GetConvolutionParameterfvEXT parameter <pname> is not
  888.     CONVOLUTION_FILTER_SCALE_EXT, CONVOLUTION_FILTER_BIAS_EXT,
  889.     CONVOLUTION_BORDER_MODE_EXT, CONVOLUTION_FORMAT_EXT,
  890.     CONVOLUTION_WIDTH_EXT, CONVOLUTION_HEIGHT_EXT, MAX_CONVOLUTION_WIDTH_EXT
  891.     or MAX_CONVOLUTION_HEIGHT_EXT.
  892.  
  893.     INVALID_ENUM is generated if GetConvolutionParameterivEXT or
  894.     GetConvolutionParameterfvEXT parameter <target> is CONVOLUTION_1D_EXT
  895.     and <pname> is CONVOLUTION_HEIGHT_EXT or MAX_CONVOLUTION_HEIGHT_EXT.
  896.  
  897.     INVALID_OPERATION is generated if ConvolutionFilter1DEXT,
  898.     ConvolutionFilter2DEXT, CopyConvolutionFilter1DEXT,
  899.     CopyConvolutionFilter2DEXT, GetConvolutionFilterEXT, SeparableFilter2DEXT,
  900.     GetSeparableFilterEXT, ConvolutionParameteriEXT,
  901.     ConvolutionParameterivEXT, ConvolutionParameterfEXT,
  902.     ConvolutionParameterfvEXT, GetConvolutionParameterivEXT, or
  903.     GetConvolutionParameterfvEXT is executed between execution of Begin and
  904.     the corresponding execution of End.
  905.  
  906. New State
  907.  
  908.     Get Value                Get Command            Type        Initial Value        Attribute
  909.     ---------                -----------            ----        -------------        ---------
  910.     CONVOLUTION_1D_EXT            IsEnabled            B        False            pixel/enable
  911.     CONVOLUTION_2D_EXT            IsEnabled            B        False            pixel/enable
  912.     SEPARABLE_2D_EXT            IsEnabled            B        False            pixel/enable
  913.     CONVOLUTION_FILTER_SCALE_EXT    GetConvolutionParameterivEXT    3 x R4        (1,1,1,1)        pixel
  914.     CONVOLUTION_FILTER_BIAS_EXT        GetConvolutionParameterivEXT    3 x R4        (0,0,0,0)        pixel
  915.     CONVOLUTION_BORDER_MODE_EXT        GetConvolutionParameterivEXT    3 x Z1        REDUCE_EXT        pixel
  916.  
  917.     CONVOLUTION                GetConvolutionFilterEXT        2 x I        empty                -
  918.     SEPARABLE                GetSeparableFilterEXT        1 x I        empty                -
  919.     CONVOLUTION_FORMAT_EXT        GetConvolutionParameterivEXT    3 x Z8        RGBA                -
  920.     CONVOLUTION_WIDTH_EXT        GetConvolutionParameterivEXT    3 x Z+        0                -
  921.     CONVOLUTION_HEIGHT_EXT        GetConvolutionParameterivEXT    2 x Z+        0                -
  922.  
  923.     POST_CONVOLUTION_RED_SCALE_EXT    GetFloatv            R        1            pixel
  924.     POST_CONVOLUTION_GREEN_SCALE_EXT    GetFloatv            R        1            pixel
  925.     POST_CONVOLUTION_BLUE_SCALE_EXT    GetFloatv            R        1            pixel
  926.     POST_CONVOLUTION_ALPHA_SCALE_EXT    GetFloatv            R        1            pixel
  927.     POST_CONVOLUTION_RED_BIAS_EXT    GetFloatv            R        0            pixel
  928.     POST_CONVOLUTION_GREEN_BIAS_EXT    GetFloatv            R        0            pixel
  929.     POST_CONVOLUTION_BLUE_BIAS_EXT    GetFloatv            R        0            pixel
  930.     POST_CONVOLUTION_ALPHA_BIAS_EXT    GetFloatv            R        0            pixel
  931.  
  932. New Implementation Dependent State
  933.  
  934.     Get Value                Get Command            Type        Minimum Value
  935.     ---------                -----------            ----        -------------
  936.     MAX_CONVOLUTION_WIDTH_EXT        GetConvolutionParameterivEXT    3 x Z+        3
  937.     MAX_CONVOLUTION_HEIGHT_EXT        GetConvolutionParameterivEXT    2 x Z+        3
  938.